package com.android.djlmapp.activity.my;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.constraint.ConstraintLayout;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.android.djlmapp.R;
import com.android.djlmapp.activity.my.moneyout.BalanceTurnOutActivity;
import com.android.djlmapp.activity.recharge.AddMoneyActivity;
import com.android.djlmapp.base.BaseActivity;
import com.android.djlmapp.tools.global.UserInfoUtils;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;


public class InOutMoneyActivity extends BaseActivity {
    public static final String TAG = "djlm-my: ";
    @BindView(R.id.ll_top_back)
    LinearLayout llTopBack;
    @BindView(R.id.tv_name)
    TextView tvName;
    @BindView(R.id.tv_top_jump)
    TextView tvTopJump;
    @BindView(R.id.home_iv_readpoint)
    ImageView homeIvReadpoint;
    @BindView(R.id.top_notes)
    ImageView topNotes;
    @BindView(R.id.iv_top_msg)
    ConstraintLayout ivTopMsg;
    @BindView(R.id.iv_top_set)
    ImageView ivTopSet;

    Unbinder unbinder;
    @BindView(R.id.my_out_money)
    RelativeLayout myOutMoney;
    private Context mContext;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_in_out_money);
        unbinder = ButterKnife.bind(this);
        mContext = getApplication();

        initView();
        initData();
    }

    @Override
    protected void initView() {
        ivTopMsg.setVisibility(View.GONE);
        ivTopSet.setVisibility(View.GONE);
        tvName.setText("加款/转出");

        if ("1".equals(UserInfoUtils.getUserInfoUtilsInstance().GetBDZCQX())) {
            myOutMoney.setVisibility(View.VISIBLE);
        } else {
            myOutMoney.setVisibility(View.GONE);
        }
    }

    @Override
    protected void initData() {

    }

    @OnClick({R.id.ll_top_back, R.id.my_in_money, R.id.my_out_money})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.ll_top_back:
                finish();
                break;
            case R.id.my_in_money:
                startActivity(new Intent(this, AddMoneyActivity.class));
                break;
            case R.id.my_out_money:
//                getZhuanZhang();
                startActivity(new Intent(this, BalanceTurnOutActivity.class));
                break;
        }
    }


    @Override
    protected void onDestroy() {
        super.onDestroy();
        unbinder.unbind();
    }
}
